package com.zlp.pay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @Description:
 * @date: 2019/5/13 11:22
 * @Author: ZouLiPing
 * @contact: 请关注微信公众号“给自己一个smile”里面有详细电商项目文档,weixin:zlp865391093
 */
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    public static String app_id = "2016092900622761";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQpNHsjapiIpYT2Caj6uRVkxXTLZG6ohR9zIcA0LIMSKWivUd3NlSscRmWUceab2Mow4ZYpu8dW/T/lIqzvmwSOHN6wyHBa4mj0Rdi30qEe4L8KU1J1V1Kp+KBkwisBRmqEPoiBiq2lWBwkg6WVes8ZcSQSeoXZ57Q3etnezqY8KDAO7e85vjmG0u1QbDGz18+KPRbe+C/4vqY/NEPGSjQdmhLC7lo4p0jY6wi+d89OteUNhfr1lsBrOgbbx6rEdvtcZn2UTggW4ZMEmdsq6KNBw+Y+cOwpgPH/aNhEem7Q8uMHbQjutjSHjxEPbjUIZgNbU1v9U3akj4Rih8eTQdhAgMBAAECggEAbdvBVVmDv2Vld00EjBsrsZM1UF+b/5R629Er+IKJuKq0oxX/4ZtyVEbSmEkkwTc4qQ1YTJz9n97oBfZcIojOrEgT7XmnebCjqbh1erL9dgIZSkxUV2+mm71HXALA42Y8R979HDpy1po91UIZsjUvpX/l+3EoSv54sUrcMIx3xRBYKH2WvOyFZ/+nEbLDkQQwAfCYR97EVnf2BO/jSIyOtInBoq0t51fvTFknSWSS7ecEox/nkZPNYn/8bdlyoCRX6A5w0wi67g/jQCDVv/MP2W400hTyt+41UhIQyEUi4yr4dCkNRM7SYLHj7oAaOF5bhqr9yt74i87nbSoIBDWlAQKBgQDVZH84U34r5odW4emIv4fVbSTcGf4LgiO6cflHvwJ+8PhTUOddagOR9BtV0dvcdKIJYLc0EDP7tP8MbUJQA3bOmvXfkRf616oDxhn4eUYJvsB59xrH+z8z3bJ/wybOQ1r8wd3kjUDwcttFe3RjIh98+rP7SNplxjDqX2QGBQB6PQKBgQCthj//ul1ZxV+1NaD0afxnTlao9UGI7sTdQeROg+5jGWFU2fknowHRUFGzCwdRcFURoCz1NpZH+ruwKSqVQAz6/YdeD1juVY6c2wkwp3s9Zq8usA6FedHiQ576AgiCXmkzWerhs8qDfRxDuOJOPuyw0AldZWoM+MZxbB0aGGfn9QKBgQCCfkNiIYS9ueq3kc0rJ90cAfOReX+mb/4DTSFg44jWMevZn1btBCCMx5dTwtLNnLFeRLuj5ei0GzoA0mvD3Gpx68dB4UulxO6eAi3tidPvr6uqqhbBhn5e7Er04FVBu2TPvoo/8rVslQBMHDPPT5Wr6u/XUfTkWe+d05mqKLLjDQKBgGcAh8DO6Va+WF+CY/Zxa0gPMlW8r5gO04Da+iC5I6pjiGkLsmAa3JtY6AY1h7SJz5VU1RsBuhcj+IFLDmHl0U6za8UjqxBebPci9cORxw/dgiNekmAcvb9nkFirGE36qMu4ljo/tPh0LXDtsDfuFiWmd8ieyGLG0VTGbkftMNB5AoGAY3arUTvHxTwuH67sSidBhdly+NNor9ZzCtGMB4qgmLhR6/lWrmgRNSFEnUB04a2vgC46XxNY0hXguEzQy84WxXDPF7dizc9mAbcVvBgqWSQZEe1Mt/0XF7nvbZVFPZ/vYbOzkxYQMno+mBJ0lQeJf8lQcnul3nVCtFZgwI6Uc/8=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1nmOEkowjWQE+zVyNf/EuNZWwXtlewZceiEWyl9thHEpWvjQPKooDEJ9Dgsb+7NsH2uycF7ANvvfvo6ECKla7NyLS5nRbfpBKjVs0KywBg/X+gf+mDN7aAqjRY+MH3leFLCzBUnwf2PQb5lfHNYWXdPzHyKo5kfvPm3xWw0bQkYtNftunrws5TzYgv9FapghtOIqpr0Ly4A4BVKmX/Gh1yWQsIcUERLJdsk3pMf2In+pUVJcuuBqF2WoIZqAmPeokPBz8aA+5ZS+wSTMQlMhy84UzsIaYx6TE2FL9hcn/oUjZdPTw+smR2Qw2y1MgbLjvvxsLbub4/XGyPoQbGZgawIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://127.0.0.1:9160/alipay.trade.page.pay-JAVA-UTF-8=/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://127.0.0.1:9160/alipay.trade.page.pay-JAVA-UTF-8/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
